var Feng = {
	userId:localStorage.getItem("userId"),
    ctxPath: "",
    addCtx: function (path) {
        if (this.ctxPath == ""){
            this.ctxPath = path;
        }
    } ,
    log: function (msg) {
        console.log(msg);
    },
    alert: function (info, iconIndex) {
//      parent.layer.msg(info, {
//          icon: iconIndex
//      });
        parent.layer.msg(info);
    },
    info: function (info) {
        Feng.alert(info, 0);
    },
    success: function (info) {
        Feng.alert(info, 1);
    },
    error: function (info) {
        Feng.alert(info, 2);
    },
    open:function(info){
    	layer.open({content:info});
    }  
    
}


//判断浏览器
Feng.isWeixin = function(){
//	if(!YDUI.device.isWeixin)
//	{
////		layer.confirm('请使用微信端进入本网站', {
////			btn: ['确定'], //按钮
////          cancel: function(index, layero){
////              window.location.href="index.html";
////          }
////      },function(){
////			window.location.href="index.html";
////		});	
//	}
}



//获取项目地址
$(function () {
//  var baseUrl = localStorage.getItem("baseUrl");
//  if (baseUrl === '/') baseUrl = '';
	//本地IP
	var url = window.location.protocol+"//"+window.location.hostname+":8089";
//	var url="http://192.168.10.:8089";//刘
	//公众号地址
//	var url = "http://wisdom-site.com";
    Feng.addCtx(url+"/child/api");
    
    Feng.isWeixin();
});